﻿using Model.BusinessModel.OutPut.sys;
using Model.DomainModel.Sys;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Infrastructure.IRepository.Sys
{
    public interface ISysDataRuleRepository : IRepository<SysDataRule>
    {
        /// <summary>
        /// 获取菜单数据规则数据
        /// </summary>
        /// <param name="menuId">菜单ID</param>
        /// <param name="ruleType">规则类型</param>
        /// <returns>返回规则数据</returns>
        List<SysDataRuleOutPut> GetMenuDataRuleList(string menuId, int ruleType);

        /// <summary>
        /// 根据规则id获取数据
        /// </summary>
        /// <param name="ruleId">规则id</param>
        /// <param name="menuId">菜单ID</param>
        /// <returns></returns>
        SysDataRule? GetDataRuleByRuleIdOrMenuId(string ruleId, string menuId);

        /// <summary>
        /// 获取当前规则使用按钮
        /// </summary>
        /// <param name="ruleId"></param>
        /// <returns></returns>
        List<string> GetUseDataRuleButton(string ruleId);

        /// <summary>
        /// 批量更新IsOpen字段
        /// </summary>
        /// <param name="menuId">主键集合</param>
        /// <param name="isOpen">是否开启</param>
        /// <param name="ruleType">规则类型</param>
        void UpdateIsOpenByMenuId(string menuId, bool isOpen, int ruleType);

        /// <summary>
        /// 批量更新IsOpen字段
        /// </summary>
        /// <param name="ruleId">规则id</param>
        /// <param name="isOpen">是否开启</param>
        /// <param name="ruleType">规则类型</param>
        void UpdateIsOpenById(string ruleId, bool isOpen, int ruleType);

    }
}
